<template>
  <div>
    <b-list-group :flush="true">
      <b-list-group-item v-for="(item, idx) in news" :key="idx" :to="{ path: 'news', query: { id: item.id }}">
        {{ item.title }}
      </b-list-group-item>
    </b-list-group>
  </div>
</template>

<script>

import { queryByType } from '@/api/news/index'

export default {
  name: 'NewsType',
  props: {
    typeId: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      news: []
    }
  },
  created() {
    queryByType({
      newsType: this.typeId,
      page: 0,
      size: 10
    }).then(res => {
      this.news = res.data.content
    })
  }
}
</script>

<style scoped>

</style>
